<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>01-axios</title>
</head>
<body>

<div id="app">
  <button @click="handle()">获取影片信息</button>
  <ul>
    <li v-for="data in msg">
      {{data.name}}
      <img :src="data.url" alt="">
    </li>
  </ul>
</div>
<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.11/vue.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.19.2/axios.js"></script>
<script>
  const vm=new Vue({
    el:"#app",
    data:{
      msg:[],
    },
    methods:{
      handle(){
        axios.get("./package.json").then(res=>{
          return res.data
          // this.msg=res.data
        }).then(data=>{
          console.log(data)
          this.msg=data.data
        }).catch(err=>console.log(err))
      }
    }
  })
</script>
</body>
</html>